package service.dataBase;

import java.sql.SQLException;
import java.util.ArrayList;

import service.exceptions.BadQueryInputException;
import service.exceptions.DBAlreadyRunningException;
import service.exceptions.DBInsertException;
import service.exceptions.NotHereException;

public class DBTester {

	/**
	 * @param args
	 * @throws DBAlreadyRunningException 
	 * @throws BadQueryInputException 
	 * @throws DBInsertException 
	 * @throws SQLException 
	 * @throws NotHereException 
	 */
	
	public static void main(String[] args) throws DBAlreadyRunningException, BadQueryInputException, DBInsertException, SQLException, NotHereException {
		DataBase db=new DataBase();
		ArrayList<Object[]> result= db.runAQuery().selectFromTable("productos", "*", null);
		db.runAQuery().PrintQuery(result);
		db.closeConnection();
		
		BusinessConector a=new BusinessConector();
		System.out.println(a.getArticle(5).toString());
		
		/*db.insert().insertIntoProductos(new String[] {"piza","100","1","..."});
		db.insert().insertToTable("productos", "nombre, precio,id_categoria", "'una piza',5,1");
		result= db.runAQuery().selectFromTable("productos", "*", null);
		db.runAQuery().PrintQuery(result);*/
		
	}

}
